package cn.anl.controller;


import cn.anl.result.ApiResponse;
import cn.anl.service.ISysMenuService;
import cn.anl.service.RedisService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 菜单权限表 前端控制器
 * </p>
 *
 * @author Anl
 * @since 2024-07-06
 */
@RestController
@RequestMapping("/menu")
public class SysMenuController {
    @Resource
    private ISysMenuService iSysMenuService;
    @Resource
    private RedisService redisService;
    /**
     * @Desc 查询所有菜单及其子菜单
     * @Author 安奈
     * @Date 2024/7/7 20:33 @TODO 目前查的是全部的，没有做权限处理且只查到二级菜单
     **/
    /**
     * 获取路由信息
     *
     * @return 路由信息
     */
    @GetMapping("getRouters")
    public ApiResponse<Object> getRouters() {
        return ApiResponse.success(iSysMenuService.buildMenuTreeForUser());
    }
}
